package org.lw.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
/*
*    Spring MVC初始化类
* */
public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    /*
    *    getRootConfigClasses()方法用于指定ContextLoaderListener创建的应用上下文的配置类
    * */
    @Override
    protected Class<?>[] getRootConfigClasses() {

        return new Class[]{AppConfig.class};
    }
    /*
    *   getServletConfigClasses()方法用于指定DispatcherServlet创建的应用上下文的配置类
    * */
    @Override
    protected Class<?>[] getServletConfigClasses() {

        return new Class[]{WebConfig.class};
    }

    @Override
    protected String[] getServletMappings() {

        return new String[]{"/api/*"};
    }
}
